package com.lln.cjcx.interceptor
import org.springframework.web.servlet.ModelAndView
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import java.util.logging.Logger;
public abstract open class M public constructor() : org.springframework.web.servlet.HandlerInterceptor {
	companion object cc{
		@JvmStatic public fun log(msg: String?) = Logger.getGlobal().log(java.util.logging.Level.INFO, msg ?: "<null>")
	}
	abstract override fun toString():String;
	private var preHandle: String = ""
		private set;
	private  var postHandle: String = ""
		private set;
	private var afterCompletion: String = ""
		private set;
	init{
		val st="正在初始化拦截器[${this.toString()}]";
		println(st)
		log(st)
	}
	public override open fun preHandle(request: HttpServletRequest?, response: HttpServletResponse?, handler: Any?): Boolean {
		this.preHandle = "${this.toString()} called preHandle(request=$request,response=$response,handler=$handler)"
		System.out.println(preHandle)
		log(preHandle)
		return false
	}
	public override open fun postHandle(request: HttpServletRequest?, response: HttpServletResponse?, handler: Any?, modelAndView: ModelAndView?) {
		this.postHandle = "${this.toString()} called postHandle(request=$request,response=$response,handler=$handler,modelandview=$modelAndView)"
		System.out.println(postHandle)
	}
	public override open fun afterCompletion(request: HttpServletRequest?, response: HttpServletResponse?, handler: Any?, ex: java.lang.Exception?) {
		this.afterCompletion = "${this.toString()} called afterCompletion(request=$request,response=$response,handler=$handler,ex=$ex)"
		System.out.println(afterCompletion)
		log(afterCompletion)
	}
}
